{literal}
<script type="text/javascript">
    $(document).ready(function() {
        $('select.carcant').live("change", function() {
            var id = $(this).children(":selected").attr("id");
            var cant = $(this).attr("value");
            //alert(id+' '+cant);
            //return false;
            $.getJSON('{/literal}{$smarty.const.BASE_WEB_ROOT}{literal}/svc/delivery/', {
                "id":id,
                "cant": cant
            }, function(data) {
                //if(data.status=='ok'){
                $('span#cdescuento').html('$' + data.promo);
                $('span#ctotal').html('$' + data.total);
                //$('span#ctotalprod'+id).html('S/. '+data.totalprod);
                //alert('¡Listo! Carrito actualizado');
                //}else{
                //}
            });
            return false;
        });

        $('a.btnContinuar').click(function() {
            var delivery = $('select.carcant').val();
            if (delivery == '') {
                alert('Seleccione Delivery');
                return false;
            }
        });
    });
</script>
{/literal}
<div id="contenedor">
    <div id="contenido">
        <div id="col_right">
            <div class="buscador_carrito_interno">
                <div class="ofertas">Carrito de Compras</div>
            </div>
            <div class="msj_error" style="float: left; margin-bottom: 10px;color: red; font-size: 14px; font-weight: bold; line-height: 20px; font-family: Tahoma;">
                 {$error}
            </div>
            <div class="info">
                <form id="car_text_tab" action="{$smarty.const.WEB_ROOT}/svc/actualizar-carrito" method="post">
                    <table width="940" cellpadding="1" cellspacing="1" id="tCarrito">
                        <tbody>
                            {if count($matriz) > 0}
                            <tr>
                                <th width="150" align="center">Producto</th>
                                <th width="400" align="center">Detalle</th>
                                <th width="80" align="right">Unidad</th>
                                <th width="50" align="right">Cantidad</th>
                                <th width="80" align="right">Precio</th>
                                <th width="100">Retirar</th>
                            </tr>
                            {else}
                            <tr>
                                <th width="100%" align="center" colspan="6">Tu carrito esta vacío.</th>
                            </tr>
                            {/if}
                            {if count($matriz) > 0}
                            {foreach from=$matriz item=carrito}
                            <tr>
                                <td align="center"><img src="{$smarty.const.BASE_WEB_ROOT}/svc/get-img/productos-pro_{$carrito.pro_id}/80" alt="" /></td>
                                <td align="center" valign="middle"><a href="{$smarty.const.BASE_WEB_ROOT}/producto-detalle/{$carrito.pro_key}"><b>{$carrito.pro_titulo}</b></a><br /><!--12 Arreglo Múltiple--> </td>
                                <td align="right" valign="middle">${$carrito.pro_precio}</td>
                                <td align="right" valign="middle"><input type="text" name="{$carrito.pro_id}" maxlength="3" value="{$carrito.pro_cantidad}" style="width:30px"/></td>
                                <td align="right" valign="middle">${$carrito.pro_sub_total}</td>
                                <td align="center" valign="middle">
                                    <a href="{$smarty.const.WEB_ROOT}/svc/elimina-elemento/{$carrito.pro_id}">
                                        <img src="{$smarty.const.BASE_WEB_ROOT}/img/delete.png" alt=""/>
                                    </a>
                                </td>
                            </tr>
                            {/foreach}
                            {else}
                            <tr bgcolor="#E8E0D0">
                                <td align="center" valign="middle" colspan="6" style="padding: 10px 0;">
                                    <a href="{$smarty.const.WEB_ROOT}" class="btnContinuar" style="padding: 5px 2.5px;">
                                        Ver los nuevos productos.
                                    </a>
                                </td>
                            </tr>
                            {/if}
                            {if count($matriz) > 0}
                            <tr>
                                <td colspan="3" rowspan="6">
                                    <div class="ofertas_cuadrito">
                                        <div class="ofertas_cuadrito_content" align="center">
                                            <p>¿Necesita ayuda? envíanos un correo a <br />
                                                <a href="mailto:contacto@manda.com.pe">contacto@manda.com.pe</a> <br />
                                                (L - V de 9am a  6pm, Sábado de 9am a 2pm). <br /></p>
                                        </div>
                                    </div>
                                </td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right"><p><b>Delivery :</b></p></td>
                                <td align="center" colspan="2">
                                    <select class="carcant" name="cant">
                                        <option id="" value="">Distrito</option>
                                        {$html}
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td align="right"><b>SubTotal :</b></td>
                                <td align="right"><b>${$subtotal}</b></td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right"><b>Delivery :</b></td>
                                <td align="right"><b><span id="cdescuento">${$precioDelivery}</span></b></td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr bgcolor="#E8E0D0">
                                <td align="right"><b>Total :</b></td>
                                <td align="right"><b><span id="ctotal">${$total}</span></b></td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr bgcolor="#E8E0D0">
                                <td height="42">&nbsp;</td>
                                <td valign="middle" align="right" colspan="2"><a class="btnSeguir" href="{$smarty.const.BASE_WEB_ROOT}">Seguir comprando</a></td>
                                <td valign="middle" align="center"><input name="recalcular" type="submit" class="btnRecalcular" value="Recalcular" /></td>
                                <td valign="middle" align="center"><a class="btnContinuar" href="{$smarty.const.BASE_WEB_ROOT}/shipping">Continuar</a></td>
                                <td>&nbsp;</td>
                            </tr>
                            {/if}
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>